package com.ssy.lingxi.feign;

import com.ssy.lingxi.common.response.Wrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
/**
* 文件上传删除api接口
* @author wrc
* @date 2020/6/18
*/
@FeignClient(name = "file-service")
public interface UploadControllerFeign {

    /**
     * 上传文件没有限制文件类型
     * fileType 文件上传类型:1.阿里云oss 2.fastdfs
     * @author wrc
     * @date 2020/5/29
     */
    @PostMapping(value = "/file/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Wrapper<String> upload(@RequestPart("file") MultipartFile file);


    /**
     * 删除文件-根据文件访问url删除
     * fileType 文件上传类型:1.阿里云oss 2.fastdfs
     * @author wrc
     * @date 2020/5/29
     */
    @PostMapping(value="/file/delete",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Wrapper<Void> delete(@RequestPart(value = "fileUrl") String fileUrl);
}
